#
# This file is a part of the open-eBackup project.
# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
# If a copy of the MPL was not distributed with this file, You can obtain one at
# http://mozilla.org/MPL/2.0/.
#
# Copyright (c) [2024] Huawei Technologies Co.,Ltd.
#
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
#

from abc import ABCMeta, abstractmethod

from common.common_models import ActionResult, SubJobDetails
from common.const import SubJobStatusEnum


class SingleRestoreBase(metaclass=ABCMeta):
    """恢复任务基类
    """
    def __init__(self, pid, job_id, sub_job_id, job_param):
        self.pid = pid
        self.job_id = job_id
        self.sub_job_id = sub_job_id
        self.job_param = job_param

    @abstractmethod
    def allow_restore_in_local_node(self):
        """是否允许本节点执行恢复"""
        pass

    @abstractmethod
    def exec_restore_pre(self):
        """恢复前置任务"""
        pass

    @abstractmethod
    def exec_restore(self):
        """恢复子任务"""
        pass

    @abstractmethod
    def exec_restore_post(self):
        """恢复后置任务"""
        pass
